package com.zl.easybuy.web;

import com.zl.easybuy.pojo.News;
import com.zl.easybuy.pojo.Product;
import com.zl.easybuy.service.NewsService;
import com.zl.easybuy.vo.ProductCategoryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
@Controller
@RequestMapping("/admin")
public class NewsController {
    @Autowired
    NewsService newsService;
    @RequestMapping("/news/newsDeatil")
    public  String queryNewsDeatil(Integer id, Model model){
        News news = newsService.queryById(id);
        model.addAttribute("news",news);
        return "forward:/backend/news/newsDetail.jsp";

    }
}
